<?php
$this->breadcrumbs=array(
    Yii::t('site','Wiki Pages') => array('index'),
    Yii::t('site','Manage')
);

$this->menu=array(
    array('label'=>Yii::t('site','Item'),'items'=>array(
        array('label'=>Yii::t('site','Create New Wiki Page'), 'url'=>array('create')),
    )),
    array('label'=>Yii::t('site','All Items'),'items'=>array(
        array('label'=>Yii::t('site','List Wiki pages'), 'url'=>array('index')),
    )),
);
?>

<h1><?php echo CHtml::encode(Yii::t('site','Manage Wiki Pages')); ?></h1>

<?php $this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=>$model->search(),
    'filter'=>$model,
    'afterAjaxUpdate'=>'fixHeaders',
    'columns'=>array(
        array(
            'class'=>'CButtonColumn',
        ),
        array(
            'type'=>'raw',
            'value'=>'CHtml::link(\'SQL\',array(\'exportDBChangeScript\',\'id\'=>$data->id))',
        ),
        array(
            'name'=>'wikiBook',
            'type'=>'raw',
            'value'=>'$data->wikiBookId>0 ? CHtml::link($data->wikiBook->name,array("/wikiBook/view","id"=>$data->wikiBookId)) : "&ndash;"',
            'filter' => WikiBook::model()->selectOptions

        ),
        array(
            'name'=>'title',
            'type'=>'raw',
            'value'=>'CHtml::link(CHtml::encode($data->title), $data->url)'
        ),
        array(
            'name'=>'status',
            'value'=>'Lookup::item("PostStatus",$data->status)',
            'filter'=>Lookup::items('PostStatus'),
        ),
        'tags',
        array(
            'name'=>'tsCreated',
            'type'=>'raw',
            'value'=>'$data->timestamp->tsCreated>0 ? CHtml::encode(Yii::app()->dateFormatter->formatDateTime($data->timestamp->tsCreated,\'medium\',\'short\')) : \'-\'',
            //'sortable'=>true,
        ),
    ),
)); ?>
